package sg.edu.nus.iss.vmcs.ui.awt;

import java.awt.Color;
import java.awt.TextField;
import java.awt.event.ActionListener;

import sg.edu.nus.iss.vmcs.ui.VMCSAbstractTextField;
import sg.edu.nus.iss.vmcs.ui.VMCSEventHandler;

public class TextFieldAdapter extends TextField implements VMCSAbstractTextField {
	
	public void setColumns(int length) {
		super.setColumns(length);
	}

	@Override
	public void setBackground(int r, int g, int b) {
		super.setBackground(new Color(r, g, b));
	}

	@Override
	public void addEventHandler(VMCSEventHandler e) {
		if (e instanceof ActionListener) {
			super.addActionListener((ActionListener)e);
		}
	}

	@Override
	public void setForeground(int r, int g, int b) {
		super.setForeground(new Color(r, g, b));
	}

}
